<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
            <script>
                    function mar() {            //创建一个函数
                        this.name = 'tom';       //用对象的方法创建函数
                        this.age =24;

                    }
                   var s = new mar();
                   console.log(s);
                console.log(s.name);
                console.log(s.age)
            </script>
</body>
</html>